package com.emmmya.ocs.modules.system.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.emmmya.ocs.modules.system.entity.Role;
import com.emmmya.ocs.common.entity.IntermediateEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper extends BaseMapper<Role> {

    Role selectByPrimaryKey(Long id);

    int deleteByPrimaryKey(Long id);

    //int insert(Role record);

    int insertSelective(Role record);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    int deleteRoleMenuByRoleId(Long id);

    int insertRoleMenus(@Param("roleMenus") List<IntermediateEntity> roleMenus);

    int deleteRolePermissionByRoleId(Long id);

    int insertRolePermissions(@Param("rolePermissions") List<IntermediateEntity> rolePermissions);


}